import java.util.Scanner;

// 教员要求张浩使用面对对象思想编写一个计算器(Calculator)，可以实现两个整数的加，减，乘，除运算。
public class Demo1 {
	int num1;
	String op;
	int num2;

	public void result() {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入第一个数：");
		this.num1 = input.nextInt();
		System.out.println("请输入第二个数：");
		this.num2 = input.nextInt();
		System.out.println("1、加，2、减，3、乘，4、除");
		System.out.println("请选择：");
		this.op = input.next();

		switch (op) {
		case "1":
			System.out.println("加法" + (num1 + num2));
			break;
		case "2":
			System.out.println("减法" + (num1 - num2));
			break;
		case "3":
			System.out.println("乘法" + (num1 * num2));
			break;
		case "4":
			System.out.println("除法" + (num1 / num2));
			break;
		}
	}

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		Demo1 sum = new Demo1();
		sum.result();
	}
}
